package cn.swust.designpatternlearningplatform.domain.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 试卷dto
 *
 * @author Tang
 * @date 2023/5/15 16:11
 **/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PaperDto {
    /**
     * 试卷总分数
     *
     * @author Tang
     * @date 2023/5/15 16:44
     **/
    private BigDecimal totalScore;
    /**
     * 每种题型的分数
     *
     * @author Tang
     * @date 2023/5/15 16:49
     **/
    private Map<String,Integer> score = new HashMap<>(4);
    /**
     * 判断题
     *
     * @author Tang
     * @date 2023/5/14 22:10
     **/
    private List<TopicDto> judgeList;
    /**
     * 选择题
     *
     * @author Tang
     * @date 2023/5/14 21:59
     **/
    private List<TopicDto> choiceList;
    /**
     * 多项选择
     *
     * @author Tang
     * @date 2023/5/14 22:01
     **/
    private List<TopicDto> multipleChoiceList;
    /**
     * 简答题
     *
     * @author Tang
     * @date 2023/5/14 22:08
     **/
    private List<TopicDto> shortAnswerQuestionList;

    public PaperDto() {
        this.score.put("judge",0);
        this.score.put("choice",0);
        this.score.put("multipleChoice",0);
        this.score.put("shortAnswerQuestion",0);
    }
    public void setEachJudgeScore(BigDecimal aim) {
        score.put("judge",aim.intValue());
    }
    public void setEachChoiceScore(BigDecimal aim) {
        score.put("choice",aim.intValue());
    }
    public void setEachMultipleChoiceScore(BigDecimal aim) {
        score.put("multipleChoice",aim.intValue());
    }
    public void setEachShortAnswerQuestionScore(BigDecimal aim) {
        score.put("shortAnswerQuestion",aim.intValue());
    }
}
